<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('工资核算详情列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <!--                <table id="bootstrap-table"></table>-->
            <table class="table table-bordered table-striped">
                <thead>
                <tr>
                    <th>
                        项目名称
                    </th>
                    <th>
                        类型
                    </th>
                    <th>
                        金额
                    </th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="detail : ${accountDetail}">
                    <th class="text-nowrap" th:text="${detail.allocationName}"></th>
                    <td  th:text="${detail.type == '1'}? '增加' : '减少'"></td>
                    <td th:text="${detail.money}" colspan="3"></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('business:detail:edit')}]];
    var removeFlag = [[${@permission.hasPermi('business:detail:remove')}]];
    var prefix = ctx + "business/detail";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "工资核算详情",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'accountId',
                    title: '关联表id'
                },
                {
                    field: 'allocationId',
                    title: '项目id'
                },
                {
                    field: 'allocationName',
                    title: '项目名称'
                },
                {
                    field: 'type',
                    title: '计算规则'
                },
                {
                    field: 'money',
                    title: '涉及金额'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>